package com.lineengine.lineengine.pipeline;

import cn.hutool.core.collection.CollUtil;
import com.lineengine.lineengine.context.IContext;
import com.lineengine.lineengine.node.AbstractConditionalNode;
import com.lineengine.lineengine.node.INode;

import java.util.List;

/**
 * <p>
 * 抽象Pipeline
 * </p>
 *
 * @author wenrong.yu
 * @since 2020-11-08 10:58
 */
public abstract class AbstractPipeline<T extends IContext<T>> extends AbstractConditionalNode<T> {
    protected List<INode<T>> nodes;

    protected void preCheck() {
        if (CollUtil.isEmpty(this.nodes)) {

        }
    }

    @Override
    public boolean apply(T context) {
        this.preCheck();
        return true;
    }
}
